home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_HDF.idb / usr / freeware / include / hdf / mfgr.h.z / mfgr.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  6.9 KB  |  141 lines

  1. /****************************************************************************
  2.  * NCSA HDF                                                                 *
  3.  * Software Development Group                                               *
  4.  * National Center for Supercomputing Applications                          *
  5.  * University of Illinois at Urbana-Champaign                               *
  6.  * 605 E. Springfield, Champaign IL 61820                                   *
  7.  *                                                                          *
  8.  * For conditions of distribution and use, see the accompanying             *
  9.  * hdf/COPYING file.                                                        *
  10.  *                                                                          *
  11.  ****************************************************************************/
  12.  
  13. /* $Id: mfgr.h,v 1.18 1998/02/20 19:25:14 koziol Exp $ */
  14.  
  15. /*-----------------------------------------------------------------------------
  16.  * File:    mfgr.h
  17.  * Purpose: header file for multi-file general raster information
  18.  * Dependencies: 
  19.  * Invokes:
  20.  * Contents:
  21.  * Structure definitions: 
  22.  * Constant definitions: 
  23.  *---------------------------------------------------------------------------*/
  24.  
  25. /* avoid re-inclusion */
  26. #ifndef __MFGR_H
  27. #define __MFGR_H
  28.  
  29. /* Interlace types available */
  30. typedef int16 gr_interlace_t;
  31. #define MFGR_INTERLACE_PIXEL        0    /* pixel interlacing scheme */
  32. #define MFGR_INTERLACE_LINE            1    /* line interlacing scheme */
  33. #define MFGR_INTERLACE_COMPONENT     2    /* component interlacing scheme */
  34.  
  35. #if defined MFGR_MASTER | defined MFGR_TESTER
  36.  
  37. #include "hfile.h"
  38. #include "tbbt.h"       /* Get tbbt routines */
  39.  
  40. /* This is the size of the hash tables used for GR & RI IDs */
  41. #define GRATOM_HASH_SIZE    32
  42.  
  43. /* The tag of the attribute data */
  44. #define RI_TAG      DFTAG_VG    /* Current RI groups are stored in Vgroups */
  45. #define ATTR_TAG    DFTAG_VH    /* Current GR attributes are stored in VDatas */
  46.  
  47. /* The default threshhold for attributes which will be cached */
  48. #define GR_ATTR_THRESHHOLD  2048    
  49.  
  50. #define VALIDRIINDEX(i,gp) ((i)>=0 && (i)<(gp)->gr_count)
  51.  
  52. /*
  53.  * Each gr_info_t maintains 2 threaded-balanced-binary-tress: one of
  54.  * raster images and one of global attributes
  55.  */
  56.  
  57. typedef struct gr_info {
  58.     int32       hdf_file_id;    /* the corresponding HDF file ID (must be first in the structure) */
  59.     uint16      gr_ref;         /* ref # of the Vgroup of the GR in the file */
  60.  
  61.     int32       gr_count;       /* # of image entries in gr_tab so far */
  62.     TBBT_TREE  *grtree;         /* Root of image B-Tree */
  63.     uintn       gr_modified;    /* whether any images have been modified */
  64.  
  65.     int32       gattr_count;    /* # of global attr entries in gr_tab so far */
  66.     TBBT_TREE  *gattree;        /* Root of global attribute B-Tree */
  67.     uintn       gattr_modified; /* whether any global attributes have been modified */
  68.  
  69.     intn        access;         /* the number of active pointers to this file's GRstuff */
  70.     uint32      attr_cache;     /* the threshhold for the attribute sizes to cache */
  71. } gr_info_t;
  72.  
  73. typedef struct at_info {
  74.     int32 index;            /* index of the attribute (needs to be first in the struct) */
  75.     int32 nt;               /* number type of the attribute */
  76.     int32 len;              /* length/order of the attribute */
  77.     uint16 ref;             /* ref of the attribute (stored in VData) */
  78.     uintn data_modified;    /* flag to indicate whether the attribute data has been modified */
  79.     uintn new_at;           /* flag to indicate whether the attribute was added to the Vgroup */
  80.     char *name;             /* name of the attribute */
  81.     void * data;             /* data for the attribute */
  82. } at_info_t;
  83.  
  84. typedef struct dim_info {
  85.     uint16  dim_ref;            /* reference # of the Dim record */
  86.     int32   xdim,ydim,          /* dimensions of the image */
  87.             ncomps,             /* number of components of each pixel in image */
  88.             nt,                 /* number type of the components */
  89.             file_nt_subclass;   /* number type subclass of data on disk */
  90.     gr_interlace_t il;          /* interlace of the components (stored on disk) */
  91.     uint16  nt_tag,nt_ref;      /* tag & ref of the number-type info */
  92.     uint16  comp_tag,comp_ref;  /* tag & ref of the compression info */
  93. } dim_info_t;
  94.  
  95. typedef struct ri_info {
  96.     int32   index;              /* index of this image (needs to be first in the struct) */
  97.     uint16  ri_ref;             /* ref # of the RI Vgroup */
  98.     uint16  rig_ref;            /* ref # of the RIG group */
  99.     gr_info_t *gr_ptr;          /* ptr to the GR info that this ri_info applies to */
  100.     dim_info_t img_dim;         /* image dimension information */
  101.     dim_info_t lut_dim;         /* palette dimension information */
  102.     uint16  img_tag,img_ref;    /* tag & ref of the image data */
  103.     int32   img_aid;            /* AID for the image data */
  104.     intn    acc_perm;           /* Access permission (read/write) for image AID */
  105.     uint16  lut_tag,lut_ref;    /* tag & ref of the palette data */
  106.     gr_interlace_t im_il;       /* interlace of image when next read (default PIXEL) */
  107.     gr_interlace_t lut_il;      /* interlace of LUT when next read */
  108.     uintn data_modified;        /* whether the image or palette data has been modified */
  109.     uintn meta_modified;        /* whether the image or palette meta-info has been modified */
  110.     uintn attr_modified;        /* whether the attributes have been modified */
  111.     char   *name;               /* name of the image */
  112.     int32   lattr_count;        /* # of local attr entries in ri_info so far */
  113.     TBBT_TREE *lattree;         /* Root of the local attribute B-Tree */
  114.     intn access;                /* the number of times this image has been selected */
  115.     uintn comp_img;             /* whether to compress image data */
  116.     int32 comp_type;            /* compression type */
  117.     comp_info cinfo;            /* compression information */
  118.     uintn ext_img;              /* whether to make image data external */
  119.     char *ext_name;             /* name of the external file */
  120.     int32 ext_offset;           /* offset in the external file */
  121.     uintn acc_img;              /* whether to make image data a different access type */
  122.     uintn acc_type;             /* type of access-mode to get image data with */
  123.     uintn fill_img;             /* whether to fill image, or just store fill value */
  124.     void * fill_value;           /* pointer to the fill value (NULL means use default fill value of 0) */
  125.     uintn store_fill;           /* whether to add fill value attribute or not */
  126. } ri_info_t;
  127.  
  128. /* Useful raster routines for generally private use */
  129. extern intn GRIil_convert(const void * inbuf,gr_interlace_t inil,void * outbuf,
  130.         gr_interlace_t outil,int32 dims[2],int32 ncomp,int32 nt);
  131.  
  132. extern VOID GRIgrdestroynode(void * n);
  133.  
  134. extern VOID GRIattrdestroynode(void * n);
  135.  
  136. extern VOID GRIridestroynode(void * n);
  137.  
  138. #endif /* MFGR_MASTER | MFGR_TESTER */
  139.  
  140. #endif /* __MFGR_H */
  141.